﻿<phone:PhoneApplicationPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" 
    xmlns:Interactivity="clr-namespace:Microsoft.Practices.Prism.Interactivity;assembly=Microsoft.Practices.Prism.Interactivity.Phone"
    xmlns:vm="clr-namespace:Sample.ViewModels;assembly=Sample.ViewModels"
    x:Class="WP8.ReactivePropertyBasics"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True">
    <phone:PhoneApplicationPage.DataContext>
        <vm:ReactivePropertyBasicsViewModel />
    </phone:PhoneApplicationPage.DataContext>

    <!--LayoutRoot は、すべてのページ コンテンツが配置されるルート グリッドです-->
	<Grid x:Name="LayoutRoot" Background="Transparent">
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="*"/>
		</Grid.RowDefinitions>

		<!--TitlePanel は、アプリケーション名とページ タイトルを格納します-->
		<StackPanel Grid.Row="0" Margin="12,17,0,28">
			<TextBlock Text="ReactivePropertyBasics" Style="{StaticResource PhoneTextNormalStyle}"/>
		</StackPanel>
		<StackPanel x:Name="ContentPanel" Margin="12,0,12,0" Grid.Row="1" >
			<TextBlock TextWrapping="Wrap" Text="Appears character after 1 second."/>
			<TextBox Height="72" TextWrapping="Wrap" Text="{Binding InputText.Value, Mode=TwoWay}">
				<i:Interaction.Behaviors>
					<Interactivity:UpdateTextBindingOnPropertyChanged/>
				</i:Interaction.Behaviors>
			</TextBox>
			<TextBlock TextWrapping="Wrap" Text="{Binding DisplayText.Value}"/>
			<Button Content="Is TextBox empty or not?" Command="{Binding ReplaceTextCommand, Mode=OneWay}"/>
		</StackPanel>

	</Grid>

</phone:PhoneApplicationPage>